<%@page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.action.UserAction"%>
<%@page import="com.shsh.safemanage.util.Util"%>
<%@page import="com.shsh.safemanage.model.Problem"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="com.shsh.safemanage.dao.ProblemDao"%>
<%@page import="com.shsh.safemanage.action.BrowseProblemAction"%>

<%
{
ProblemDao theProblemDao = DaoCreator.createProblemDao();
UserAction theUserAction = ActionCreator.createUserAction();
User theUser = (User) session.getAttribute(Constants.SESSION_USER);
%>
<table align="center" border="1" width="99%" cellpadding="0" cellspacing="0">
<%
List<Problem> problemList = theProblemDao.getProblemsTobeProcessed(theUser.getId());
%>
	<tr style="font-weight: bold" align="center">
		<td class="td1" width="20%">作业部（业务中心）</td>
		<td class="td1" width="20%">装置</td>
		<td class="td1" width="20%">问题标题</td>
		<td class="td1" width="6%">发现人</td>
		<td class="td1" width="12%">填报日期</td>
		<td class="td1" width="12%">回复日期</td>
		<td class="td1" width="10%">查看</td>
	</tr>
<%
	for (Problem problem : problemList) {
		Integer problemType = problem.getProblemType();
		String targetPage = Problem.getTargetDetailedPageURL(problem, request.getContextPath());
%>
	<tr>
		<td><%=problem.getDepartment1Name()%></td>
		<td><%=problem.getEquipmentName()%></td>
		<td><%=problem.getProblemTitle()%></td>
		<td align="center"><%=problem.getWriteUserName()%></td>
		<td align="center"><%=Util.formatDate(problem.getWriteTime().getTime())%></td>
		<td>&nbsp;</td>
		<td align="center" valign="middle">
			<a href="javascript:" 
				onclick="callJspProcess('add_problem_read_id_process.jsp', {id:<%=problem.getId()%>});
					loadPageSection('<%=targetPage%>', 'mainContentDiv', {id:<%=problem.getId()%>,transferID:<%=problem.getTransferID()%>, fromPage: 'problemsTobeProcessed'}, true)"
				style="color: <%=(problem.getProcessStatus() == Constants.PROBLEM_STATUS_CLOSE)? "black":"red"%>">详细内容</a>
			<%
			if (theUserAction.isProblemBeRead(request, problem.getId())) {
			%>
			<img alt="已阅" src="images/is_read.png" />
			<%
			}
			%>
		</td>
	</tr>
<%
}
%>
</table>
<%
}
%>